package net.alteiar.images.metadata;

import java.awt.Color;

import net.alteiar.images.BasicImage;

public class ImageInfoBuilder {

	public static ImageInfo buildGrid(BasicImage img, int squareSize) {
		ImageInfo info = new ImageInfo(img, 1);

		Color c = new Color(0f, 0f, 0f, 0f);
		info.fill(c.getRGB());

		int squareWidth = img.getWidth() / squareSize;
		int squareHeight = img.getHeight() / squareSize;

		for (int x = 0; x < squareWidth; x++) {
			for (int y = 0; y < squareHeight; y++) {
				for (int i = 0; i < squareSize; ++i) {
					info.setValue(x * squareSize + i, y * squareSize,
							Color.BLACK.getRGB());
					info.setValue(x * squareSize, y * squareSize + i,
							Color.BLACK.getRGB());
				}
			}
		}

		return info;
	}
}
